x86/domain: Fix struct domain memory corruption when building PV guests
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 22 Aug 2022 21:17:18 +0000 (22:17 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 23 Aug 2022 11:22:05 +0000 (12:22 +0100)
commit399bcbf281bd936d1eff7f7d1054ab49115c3a44
tree784ffb378cf709c776a8d8ad5759e7cebfdb1b2f
parent8d9006cf4152cb8ef360ee12c4a1477992bbf85a
x86/domain: Fix struct domain memory corruption when building PV guests

arch_domain_create() can't blindly write into d->arch.hvm union.  Move the
logic into hvm_domain_initialise(), which involves passing config down.

Fixes: 2ce11ce249a3 ("x86/HVM: allow per-domain usage of hardware virtualized APIC")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/domain.c
xen/arch/x86/hvm/hvm.c
xen/arch/x86/include/asm/hvm/hvm.h